package utils.map;

import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 带使用次数限制的线程安全的map.
 *
 * @author zhangbo
 * @since 1.0.0
 */
public class TimeLimitMap<K, V> extends LimitedMap<K, V> {
    /**
     * 每个value最多可以使用total次.
     *
     * @param total
     */
    TimeLimitMap(int total) {
        this.dataMap = new ConcurrentHashMap<>();
        this.conditionMap = new WeakHashMap<>();
        this.defaultLimitKey = new TimeLimitKey(total);
    }

}
